<?php


namespace app\shop\validate;


use think\Validate;

class EditInvoiceValidate extends Validate
{
    /**
     * 定义验证规则
     * 格式：'字段名' =>  ['规则1','规则2'...]
     * @var array
     */
    protected $rule = [
        'id' => 'require|gt:0',
        'is_invoice' => 'require|in:0,1',
    ];

    /**
     * 定义错误信息
     * 格式：'字段名.规则名' =>  '错误信息'
     * @var array
     */
    protected $message = [
        'id.require' => '订单ID不能为空',
        'id.gt' => '订单ID参数错误',
        'is_invoice.require' => '请选择是否开票',
        'is_invoice.in' => '是否开票参数错误',
    ];
}